// ShowEvernoteDialog.cpp : implementation file
//

#include "stdafx.h"
#include "ShowEvernoteDialog.h"
#include "afxdialogex.h"


// ShowEvernoteDialog dialog

IMPLEMENT_DYNAMIC(ShowEvernoteDialog, CDialogEx)

	ShowEvernoteDialog::ShowEvernoteDialog(CWnd* pParent /*=NULL*/)
	: CDialogEx(ShowEvernoteDialog::IDD, pParent)
{

}

ShowEvernoteDialog::~ShowEvernoteDialog()
{
}

void ShowEvernoteDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(ShowEvernoteDialog, CDialogEx)
	ON_BN_CLICKED(IDC_Sync, &ShowEvernoteDialog::OnBnClickedSync)
END_MESSAGE_MAP()


// ShowEvernoteDialog message handlers


BOOL ShowEvernoteDialog::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	CWnd* main =GetParent();

	// TODO:  Add extra initialization here

	  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
	//http://www.functionx.com/visualc/controls/listcontrol.htm//

	CListCtrl *lstCtrl = new CListCtrl;
	lstCtrl->Create(WS_CHILD|WS_VISIBLE|WS_BORDER|LVS_REPORT|LVS_EDITLABELS,CRect(10,10,400,200), this, IDD_MYLISTCTRL);   
	lstCtrl->SetExtendedStyle(LVS_EX_CHECKBOXES);
	//
	LVCOLUMN lvColumn;

	lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
	lvColumn.fmt = LVCFMT_LEFT;
	lvColumn.cx = 120;
	lvColumn.pszText = _T("Full Name");
	lstCtrl->InsertColumn(0, &lvColumn);

	lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
	lvColumn.fmt = LVCFMT_LEFT;
	lvColumn.cx = 75;
	lvColumn.pszText = _T("Profession");
	lstCtrl->InsertColumn(1, &lvColumn);

	lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
	lvColumn.fmt = LVCFMT_LEFT;
	lvColumn.cx = 80;
	lvColumn.pszText = _T("Fav Sport");
	lstCtrl->InsertColumn(2, &lvColumn);

	lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
	lvColumn.fmt = LVCFMT_LEFT;
	lvColumn.cx = 75;
	lvColumn.pszText = _T("Hobby");
	lstCtrl->InsertColumn(3, &lvColumn);


	//
	LVITEM lvItem;
	int nItem;

	lvItem.mask = LVIF_TEXT;
	lvItem.iItem = 0;
	lvItem.iSubItem = 0;
	CString a=_T("Sandra C. Anschwitz");
	lvItem.pszText = _T("Sandra C. Anschwitz");
	nItem = lstCtrl->InsertItem(&lvItem);
	lstCtrl->SetItemText(nItem, 1, _T("Singer"));
	lstCtrl->SetItemText(nItem, 2, _T("HandBall"));
	lstCtrl->SetItemText(nItem, 3, _T("Beach"));

	lvItem.mask = LVIF_TEXT;
	lvItem.iItem = 1;
	lvItem.iSubItem = 0;
	lvItem.pszText = _T("Roger A. Miller");
	nItem = lstCtrl->InsertItem(&lvItem);
	lstCtrl->SetItemText(nItem, 1, _T("Footballer"));
	lstCtrl->SetItemText(nItem, 2, _T("Tennis"));
	lstCtrl->SetItemText(nItem, 3, _T("Teaching"));

	lvItem.mask = LVIF_TEXT;
	lvItem.iItem = 2;
	lvItem.iSubItem = 0;
	lvItem.pszText = _T("Marie-Julie W. Gross");
	nItem = lstCtrl->InsertItem(&lvItem);

	lstCtrl->SetItemText(nItem, 1, _T("Student"));
	lstCtrl->SetItemText(nItem, 2, _T("Boxing"));
	lstCtrl->SetItemText(nItem, 3, _T("Programming"));

	lvItem.mask = LVIF_TEXT;
	lvItem.iItem = 3;
	lvItem.iSubItem = 0;
	lvItem.pszText = _T("Ella Pius Roger");
	nItem = lstCtrl->InsertItem(&lvItem);

	lstCtrl->SetItemText(nItem, 1, _T("Architect"));
	lstCtrl->SetItemText(nItem, 2, _T("Ping-Pong"));
	lstCtrl->SetItemText(nItem, 3, _T("Songo"));

	return TRUE;
}


void ShowEvernoteDialog::OnBnClickedSync()
{
	CDialogEx::OnOK();
	// TODO: Add your control notification handler code here
	for(int i=0;i<4;i++){
		a[i]= ListView_GetCheckState(m_hWnd,i);
		a[i]=!a[i];
	}
	a[0]=true;
	a[1]=false;
	a[2]=true;
	a[3]=false;


}
